package org.zhxy.common.response;

public enum ResultCode {

    //系统
    SUCCESS(true,10000,"操作成功"),
    SUCCESS_NO_MESSAGE(true,10000,""),
    FAIL(false,10002,"操作失败"),
    DATA_IS_EXIST(false,10003,"数据已存在"),
    SERVER_ERROR(false,10104,"抱歉，系统繁忙，请稍后重试！"),
    MOBILE_OR_PASSWORD_OR_TYPE_ERROR(false,11111,"用户名或密码错误,或被禁用"),
    LOGIN_TIME_OUT(false,11112,"已超时,请重新登录"),
    UN_AUTH_NO_LOGIN(false,11114,"您还未登录"),
    TOKEN_EXPIRES(false,101,"token is not expires"),
    STATUS_NO_OPTION(false,102,"禁用账户无法操作"),
    UN_AUTH_PERMISSION(false,103,"权限不足"),
    //权限
    PERMISSION_IN_ROLE_HAS_DATA(false,20000,"权限中存在子级，无法删除"),
    SYSTEM_ACCESS_PERMISSION_API(false,20001,"一个按钮只能添加一个API权限"),
    SYSTEM_ACCESS_PERMISSION_HAS_ROLE(false,20002,"当前权限与相关角色绑定，无法删除"),
    SYSTEM_ACCESS_ROLE_NO_HAS_PERMISSION(false,20003,"角色需要绑定权限"),
    SYSTEM_ACCESS_ROLE_HAS_PERMISSION(false,20004,"当前角色已绑定权限，无法删除"),
    SYSTEM_ACCESS_DEPARTMENT_HAS_TEACHER(false,20005,"当前部门存在教师，无法删除"),
    SYSTEM_ACCESS_CURRENT_USER_EXIST(false,20006,"当前用户已存在，不能重复注册"),

    //教师
    LEVEL_NO_OPTION(false,30000,"离职人员无法操作"),
    MEMBER_NO_OPTION(false,30001,"已转正人员无法操作"),

    SCHOOL_IS_EXIST(false,30000,"集团信息在本系统中只能存在一个"),



    //上传
    UPLOAD_ERROR(false,90000,"上传文件出现问题，请检查文件后进行上传"),
    FILE_EMPTY(false,90001,"没有导入文件"),
    SPECIFICATION_ERROR(false,90001,"格式不正确");

    //操作是否成功
    boolean success;
    //操作代码
    int code;
    //提示信息
    String message;

    ResultCode(boolean success,int code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public boolean success() {
        return success;
    }

    public int code() {
        return code;
    }

    public String message() {
        return message;
    }
}
